package cn.edu.ctbu.scoremg.controller;

import cn.edu.ctbu.scoremg.entity.Course;
import cn.edu.ctbu.scoremg.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/course")
public class CourseController {
    @Autowired
    private CourseService courseService;
    @GetMapping("/list")
    public String getList() {
        List<Course> courses = courseService.getAll();
        return "/course/list";
    }
}

